import {Wcferry} from 'n-wcferry'

const client = new Wcferry({host: '10.211.55.6', port: 8000})
client.start()

const rooms = client.getChatRooms(true)
const roomMembers = client.getChatRoomMembers('19361196962@chatroom', true)
const friends = client.getFriends(true)
const msgTypes = client.getMsgTypes()
const selfWxid = client.getSelfWxid()
const userInfo = client.getUserInfo(true)
const contacts = client.getContacts(true)
const contact = client.getContact('wxid_0915449155011', true)
const dbNames = client.getDbNames()
const dbTables = client.getDbTables('MicroMsg.db')
const sqlRes = client.dbSqlQuery('MicroMsg.db', 'select * from ChatRoom')
const xsPyqResult = client.refreshPyq(0)
const qcyNick = client.getAliasInChatRoom('wxid_1vlq7yoa700q22', '19361196962@chatroom')
const nicks = client.getNickName(['wxid_1vlq7yoa700q22'])
client.on(msg => {
  console.log(msg.sender, msg.id)
  if (msg.sender === 'wxid_67j5z19fqqse22') {
    // client.sendTxt(msg.content, msg.sender)
    console.log(client.forwardMsg(msg.id, 'wxid_67j5z19fqqse22'))
  }
})

setInterval(() => {
}, 1000)
